//
//  JiRuDetailsViewController.m
//  明和智能
//
//  Created by 李李善 on 2018/8/24.
//  Copyright © 2018年 inno. All rights reserved.
//

#import "JiRuDetailsViewController.h"
#import "JiRuDetailsView.h"
#import "MyTouComplaintsViewController.h"
@interface JiRuDetailsViewController ()

@end

@implementation JiRuDetailsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}
-(void)onLoadViewByWillAppear:(UIView *)view
{
    view.backgroundColor = hexCOLOR(@"ECECEC");
    
    UILabel *label = ({
        UILabel *l  = [UILabel new];
        l.text = @"车位使用详情";
        l.font = kSysFont(kFitW(12));
        [view addV:l];
        l;
    });
    
    JiRuDetailsView *detailsV = ({
        JiRuDetailsView *l  = [JiRuDetailsView new];
        l.backgroundColor = [UIColor whiteColor];
        [view addV:l];
        l;
    });
    
    UIView *bjView = ({
        UIView *l  = [UIView new];
        l.backgroundColor = hexCOLOR(@"CCCCCC");
        [view addV:l];
        l;
    });
    UIView *bjView1 = ({
        UIView *l  = [UIView new];
        l.backgroundColor = hexCOLOR(@"CCCCCC");
        [view addV:l];
        l;
    });
    UILabel *money = ({
        UILabel *l  = [UILabel new];
        //l.backgroundColor = [UIColor redColor];
        l.textColor = [UIColor blackColor];
        l.text = @"对此记录有疑问?";
        l.font = kSysFont(kFitW(13));
        [view addV:l];
        l;
    });
    
    
    UIButton *che = ({
        UIButton *l  = [UIButton buttonWithType:UIButtonTypeCustom];
        [l setNormalTitle:@"客服"];
        l.titleLabel.font = kSysFont(kFitW(12));
        [l setNormalTitleColor:[UIColor blackColor]];
        l.tag = 10;
        [l AddTarget:self Action:@selector(onClickButton:)];
        l.backgroundColor = hexCOLOR(@"CCCCCC");
        l.cornerRadius= kFitW(50)/2;
        [view addV:l];
        l;
    });
    
    UIButton *timer = ({
        UIButton *l  = [UIButton buttonWithType:UIButtonTypeCustom];
        [l setNormalTitle:@"投诉"];
        l.titleLabel.font = kSysFont(kFitW(12));
        [l setNormalTitleColor:[UIColor blackColor]];
        l.tag = 20;
        [l AddTarget:self Action:@selector(onClickButton:)];
        l.backgroundColor = hexCOLOR(@"CCCCCC");
        l.cornerRadius= kFitW(50)/2;
        [view addV:l];
        l;
    });
    
    [self onMainQueueAddSub:^(UIView *view, CGPoint origin, CGSize size, CGPoint center) {
        [label sizeToFit];
        label.left = kFitW(15);
        label.top = kFitH(40);
        detailsV.frame = CGRectMake(kFitW(15), label.bottom+kFitH(12), size.width-kFitW(30),kFitH(320));
        
        che.size = CGSizeMake(kFitW(50), kFitW(50));
        che.bottom = size.height-kFitH(40);
        che.right = size.width/2-kFitW(20);
        
        timer.size = CGSizeMake(kFitW(50), kFitW(50));
        timer.bottom = size.height-kFitH(40);
        timer.left = size.width/2+kFitW(20);
        
        CGFloat w = size.width/2 -kFitW(90);
        

        [money sizeToFit];
        money.centerX = size.width/2;
        money.bottom = che.top-kFitH(20);

        
        bjView.size  = CGSizeMake(w,0.5);
        bjView.left = kFitW(10);
        bjView.centerY =money.centerY;
        
        bjView1.size  = CGSizeMake(w,0.5);
        bjView1.right = size.width-kFitW(10);
        bjView1.centerY =money.centerY;

    }];
    
    
}

-(void)onClickButton:(UIButton *)button
{
    switch (button.tag) {
        case 20:
        {
            MyTouComplaintsViewController *vc = [MyTouComplaintsViewController new];
            vc.title = @"投诉";
            [self pushToVC:vc model:nil];
        }
            break;
            
        default:
        {
            
        }
            break;
    }
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
